import { get, post } from '../http'
// 仓库列表
export const warehouiseList = (payload: any) => {
  return get('/inventory/v1/warehouse/findWarehousePageByParam', payload)
}
// 仓库列表-不分页 /inventory/v1/warehouse/findWarehouseListByParam
export const findWarehouseListByParam = (payload?: any) => {
  return get('/inventory/v1/warehouse/findWarehouseListByParam', payload)
}

// 仓库列表-不分页 /inventory/v1/warehouse/findWarehouseListByParam
export const warehouiseAllList = () => {
  return get('/inventory/v1/warehouse/findWarehouseListByParam')
}

// 创建仓库 /inventory/v1/warehouse/createWarehouse
export const createWarehouse = (payload: any) => {
  return post('/inventory/v1/warehouse/createWarehouse', payload)
}
// 更新仓库 /inventory/v1/warehouse/updateWarehouse
export const updateWarehouse = (payload: any) => {
  return post('/inventory/v1/warehouse/updateWarehouse', payload)
}

// 根据仓库编号查询仓库
export const getWarehouseInfoByCode = (payload: any) => {
  return get('/inventory/v1/warehouse/getWarehouseInfoByCode', payload)
}

// 仓位列表
export const spaceList = (payload: any) => {
  return get('/inventory/v1/warehouse/findLocationPageByParam', payload)
}
// 批量新增货位 /inventory/v1/warehouse/createLocationBatch
export const createLocationBatch = (payload: any) => {
  return post('/inventory/v1/warehouse/createLocationBatch', payload)
}
// 新增货位 /inventory/v1/warehouse/createLocation
export const createLocation = (payload: any) => {
  return post('/inventory/v1/warehouse/createLocation', payload)
}
// 批量修改备注名 /inventory/v1/warehouse/updateLocationRemarkBatch
export const updateLocationRemarkBatch = (payload: any) => {
  return post('/inventory/v1/warehouse/updateLocationRemarkBatch', payload)
}
// 批量删除货位 /inventory/v1/warehouse/deleteLocation
export const deleteLocation = (payload: any) => {
  return post('/inventory/v1/warehouse/deleteLocation', payload)
}

// 批量查询可用货位 /inventory/v1/warehouse/findAvailableLocation
export const findAvailableLocation = (payload: any) => {
  return post('/inventory/v1/warehouse/findAvailableLocation', payload)
}

// 货位解绑产品 /inventory/v1/warehouse/locationUnBindInventory
export const locationCleanInventory = (payload: any) => {
  return post('/inventory/v1/warehouse/locationCleanInventory', payload)
}
// 查询可用货位
export const findIdleLocationByWarehouse = (payload: any) => {
  return get('/inventory/v1/warehouse/findIdleLocationByWarehouse', payload)
}

// 货位绑定产品 /inventory/v1/warehouse/locationBindInventory
export const locationBindInventory = (payload: any) => {
  return post('/inventory/v1/warehouse/locationBindInventory', payload)
}

// 入库单列表 /inventory/v1/other/in/findOtherInPageByParam
export const findOtherInPageByParam = (payload: any) => {
  return get('/inventory/v1/other/in/findOtherInPageByParam', payload)
}

// 新增入库单 /inventory/v1/other/in/createOtherIn
export const createOtherIn = (payload: any) => {
  return post('/inventory/v1/other/in/createOtherIn', payload)
}

// 入库单详情
export const getOtherInInfo = (payload: any) => {
  return get('/inventory/v1/other/in/getOtherInInfo', payload)
}

// 入库单日志 /inventory/v1/other/in/findOtherInLogPage
export const findOtherInLogPage = (payload: any) => {
  return get('/inventory/v1/other/in/findOtherInLogPage', payload)
}

// 查询在线商品 /product/amzProductSale/pageRelated
export const onlineProductList = (payload: any) => {
  return get('/product/amzProductSale/pageRelated', payload)
}

// 店铺，包含共享的
export const findShopListByShare = (payload?: any) => {
  return get('/user/v1/shop/findShopMarketAndShareByParam', payload)
}

// 提交审核
export const commitOtherIn = (payload: any) => {
  return post('/inventory/v1/other/in/commitOtherIn', payload)
}
// 审核单据
export const auditOtherIn = (payload: any) => {
  return post('/inventory/v1/other/in/auditOtherIn', payload)
}

// 出库单列表
export const outFindOtherInPageByParam = (payload: any) => {
  return get('/inventory/v1/other/out/findOtherOutPageByParam', payload)
}

// 获取出库单出库商品
export const findInventoryList = (payload?: any) => {
  return get('/inventory/v1/inventory/findInventoryList', payload)
}

// 创建其他出库单
export const createOtherOut = (payload: any) => {
  return post('/inventory/v1/other/out/createOtherOut', payload)
}

// 审核出库单
export const commitOtherOut = (payload: any) => {
  return post('/inventory/v1/other/out/commitOtherOut', payload)
}

// 提交审核
export const auditOtherOut = (payload: any) => {
  return post('/inventory/v1/other/out/auditOtherOut', payload)
}

//获取出库单详情
export const getOtherOutInfo = (payload: any) => {
  return get('/inventory/v1/other/out/getOtherOutInfo', payload)
}

// 出库单日志 /inventory/v1/other/in/findOtherInLogPage
export const findOtherOutLogPage = (payload: any) => {
  return get('/inventory/v1/other/out/findOtherOutLogPage', payload)
}

// 调拨单列表
export const findTransOrderPageByParam = (payload: any) => {
  return get('/inventory/v1/transOrder/findTransOrderPageByParam', payload)
}

// 创建调拨单 /inventory/v1/other/out/createTransOrder
export const createTransOrder = (payload: any) => {
  return post('/inventory/v1/other/out/createTransOrder', payload)
}

// 文件上传
export const upload = (paylaod: any) => {
  return post('/inventory/v1/file/uploadFile', paylaod, { headers: { 'Content-Type': 'multipart/form-data' } })
}

// 获取调拨单详情 /inventory/v1/transOrder/getTransOrderInfo
export const getTransOrderInfo = (payload: any) => {
  return get('/inventory/v1/transOrder/getTransOrderInfo', payload)
}

// 更新调拨单
export const updateTransOrder = (payload: any) => {
  return post('/inventory/v1/other/out/updateTransOrder', payload)
}

// 删除调拨单
export const deleteTransOrder = (payload: any) => {
  return post('/inventory/v1/other/out/deleteTransOrder', payload)
}

// 查询仓内调拨单
export const findTransOrderInnerPageByParam = (payload: any) => {
  return get('/inventory/v1/transOrder/findTransOrderInnerPageByParam', payload)
}

// 提交审核
export const commitTransOrder = (payload: any) => {
  return post('/inventory/v1/other/out/commitTransOrder', payload)
}

// 审核单据
export const auditTransOrder = (payload: any) => {
  return post('/inventory/v1/other/out/auditTransOrder', payload)
}

// 获取单据日志
export const findTransOrderLogPage = (payload: any) => {
  return get('/inventory/v1/transOrder/findTransOrderLogPage', payload)
}

// 确认出库 /inventory/v1/other/out/confirmOutbound
export const confirmOutbound = (payload: any) => {
  return post('/inventory/v1/other/out/confirmOutbound', payload)
}

// 确认入库
export const confirmInbound = (payload: any) => {
  return post('/inventory/v1/other/out/confirmInbound', payload)
}

// 物流服务商 /express/expressProvider/listExpressProvider
export const listExpressProvider = (payload?: any) => {
  return get('/express/expressProvider/listExpressProvider', payload)
}

// 新增物流商  /express/expressProvider/saveOrUpdateExpressProvider
export const saveOrUpdateExpressProvider = (paylaod?: any) => {
  return post('/express/expressProvider/saveOrUpdateExpressProvider', paylaod)
}

// 查询物流渠道 /express/expressChannel/pageExpressChannel
export const pageExpressChannel = (payload: any) => {
  return get('/express/expressChannel/pageExpressChannel', payload)
}

// 新增或更新物流渠道 /express/expressChannel/saveOrUpdateExpressChannel
export const saveOrUpdateExpressChannel = (paylaod?: any) => {
  return post('/express/expressChannel/saveOrUpdateExpressChannel', paylaod)
}

// 批量修改状态 /express/expressChannel/updateStatusExpressChannel
export const updateStatusExpressChannel = (paylaod?: any) => {
  return post('/express/expressChannel/updateStatusExpressChannel', paylaod)
}

// 物流地址 /express/expressAddress/pageExpressAddress
export const pageExpressAddress = (payload: any) => {
  return get('/express/expressAddress/pageExpressAddress', payload)
}

// 新增或者更新物流地址 /express/expressAddress/upsertExpressAddress
export const upsertExpressAddress = (paylaod?: any) => {
  return post('/express/expressAddress/upsertExpressAddress', paylaod)
}
// 删除物流地址 /express/expressAddress/delExpressAddress
export const delExpressAddress = (paylaod?: any) => {
  return post('/express/expressAddress/delExpressAddress', paylaod)
}

// 删除渠道 /express/expressChannel/delExpressChannels
export const delExpressChannels = (paylaod?: any) => {
  return post('/express/expressChannel/delExpressChannels', paylaod)
}

// 同步渠道 /express/expressChannel/syncChannels
export const syncChannels = (paylaod?: any) => {
  return post('/express/expressChannel/syncChannels', paylaod)
}

// 删除入库单 /inventory/v1/other/in/deleteOtherIn
export const deleteOtherIn = (paylaod?: any) => {
  return post('/inventory/v1/other/in/deleteOtherIn', paylaod)
}

// 更新其他入库单 /inventory/v1/other/in/updateOtherIn
export const updateOtherIn = (paylaod?: any) => {
  return post('/inventory/v1/other/in/updateOtherIn', paylaod)
}

// 删除出库单 /inventory/v1/other/out/deleteOtherOut
export const deleteOtherOut = (paylaod?: any) => {
  return post('/inventory/v1/other/out/deleteOtherOut', paylaod)
}

// 更新其他入库单 /inventory/v1/other/out/updateOtherOut
export const updateOtherOut = (paylaod?: any) => {
  return post('/inventory/v1/other/out/updateOtherOut', paylaod)
}

// 运费模板列表
export const pageExpressFreightTemplate = (paylaod?: any) => {
  return get('/express/expressFreightTemplate/pageExpressFreightTemplate', paylaod)
}
// 新增运费模板
export const saveOrUpdateExpressFreightTemplate = (paylaod?: any) => {
  return post('/express/expressFreightTemplate/saveOrUpdateExpressFreightTemplate', paylaod)
}
// 修改运费模板状态
export const updateEnableExpressFreightTemplate = (paylaod?: any) => {
  return post('/express/expressFreightTemplate/updateEnableExpressFreightTemplate', paylaod)
}

// 查询物流运费模板
export const getExpressFreightTemplateById = (paylaod?: any) => {
  return get('/express/expressFreightTemplate/getExpressFreightTemplateById', paylaod)
}
// 货位详情
export const findInventoryPage = (paylaod?: any) => {
  return get('/inventory/v1/inventory/findInventoryPage', paylaod)
}
// 库存移除货位
export const inventoryRemoveLocation = (paylaod?: any) => {
  return post('/inventory/v1/warehouse/inventoryRemoveLocation', paylaod)
}

// 查询仓库（采购）
export const findSaasAndErpWarehouse = (paylaod?: any) => {
  return get('/inventory/v1/warehouse/findSaasAndErpWarehouse', paylaod)
}
